cmake_minimum_required(VERSION 3.16)

project(demo-app VERSION 1.0.0 LANGUAGES C CXX)

# Set these variables to build the application as a specific process on a specific machine
set(APP_NAME "demo-app")

# Load and run CMake code from a file or module
include(FindPkgConfig)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
include(NOSAL/nosal)
if(NOSAL_TARGET_MACHINE STREQUAL "QNX-SA8155")
    include(NOSAL/toolchain_qnx700_aarch64)
endif()

# Enable tests
if(NOSAL_ENABLE_TESTS)
    message(STATUS "PROJECT MESSAGE: Demo Application tests are enabled")
    #enable_testing()
    add_subdirectory(test)
endif()

# Look for required packages
find_package(nosal-demo-lib REQUIRED)

nosal_add_application(${PROJECT_NAME}
    SOURCES
        src/demo_app.cpp
        src/foo.cpp
    LIBS
        nosal::demo-lib
    INCLUDES
        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
    DEFINITIONS
    OPTIONS -Wno-noexcept-type
)


nosal_install_app_file(${PROJECT_NAME} data ${PROJECT_SOURCE_DIR}/files/data.json)
